﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {
        initControl();
        $.ajax({
            url: "/Gas/Resident/GetFormJsonForUpdate",
            data: { keyValue: keyValue },
            dataType: "json",
            async: false,
            success: function (data) {
                console.log(data);
                //formSerialize 是 framework-ui.js 中的全局函数 作用是绑定数据
                $("#form1").formSerialize(data);
            }
        });
    });
    function initControl() {
    }
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/Gas/Resident/SubmitForm?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function () {
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        })
    }
</script>

<form id="form1">
    <div style="padding-top: 20px; margin-right: 20px;">
        <input id="FaceRecognize" name="FaceRecognize" type="hidden" />
        <input id="FaceRecognizeTime" name="FaceRecognizeTime" type="hidden" />
        <input id="FaceData" name="FaceData" type="hidden" />
        <input id="CanteenId" name="CanteenId" type="hidden" />
        <table class="form">
            <tr>
                <th class="formTitle">姓名</th>
                <td class="formValue">
                    <input id="RName" name="RName" type="text" class="form-control" disabled />
                </td>
            </tr>
            <tr>
                <th class="formTitle">身份证号</th>
                <td class="formValue">
                    <input id="IDNumber" name="IDNumber" type="text" class="form-control" disabled />
                </td>
            </tr>
            <tr>
                <th class="formTitle">性别</th>
                <td class="formValue">
                    <input id="sex" name="sex" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">联系方式</th>
                <td class="formValue">
                    <input id="telephone" name="telephone" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">社区名称</th>
                <td class="formValue">
                    <input id="address" name="address" type="text" class="form-control" />
                </td>
            </tr>
            @*<tr>
                <th class="formTitle">联系方式2</th>
                <td class="formValue">
                    <input id="telephone2" name="telephone2" type="text" class="form-control" />
                </td>
            </tr>*@
        </table>
    </div>
</form>
